﻿using System;
using System.Windows.Forms;
using 售后客户管理.ModelLibrary;

namespace 售后客户管理.Forms.InternalSetting
{
    public partial class FmUserSettingModify : Form
    {
        public FmUserSettingModify()
        {
            InitializeComponent();
        }
        private Common.SqlConnectionHelper SqlConnectionHelper = new Common.SqlConnectionHelper(Program.configs,ConfigCode.Main);
        private void FmUserSettingModify_Load(object sender, EventArgs e)
        {
            this.BackColor = Common.MyColor.NewColor_LightLavender;
        }
        public FmUserSettingModify(Setting setting)
        {
            InitializeComponent();
            this.tbFId.Text = setting.FId;
            this.tbSIds.Text = setting.SIds;
            this.fcSName.Text = setting.SName;
            this.fcDefaultValue.Text = setting.DefaultValue;
            this.fcNowValue.Text = setting.NowValue;
            this.fcSLevel.Text = setting.SLevel;
            this.fcshuoming.Text = setting.shuoming;
        }
        private void BtnOK_Click(object sender, EventArgs e)
        {
            Setting setting = new Setting
            {
                FId = this.tbFId.Text,
                SIds = this.tbSIds.Text,
                SName = this.fcSName.Text,
                DefaultValue = this.fcDefaultValue.Text,
                NowValue = this.fcNowValue.Text,
                SLevel = this.fcSLevel.Text,
                shuoming = this.fcshuoming.Text
            };
            int rowcount = SqlClassLibrary.SqlGetSet.SetSetting(setting, SqlConnectionHelper.sqlConnection);
            this.Close();
        }

        private void BtnCancel_Click(object sender, EventArgs e)
        {
            this.Close();
        }

    }
}


